﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using PMS.XCMG.Entity;
using PMS.XCMG.IBusiness;
using PMS.XCMG.Util;

namespace PMS.XCMG.Business
{
    public class Sys_MenuBusiness : BusRepository<Sys_Menu>, ISys_MenuBusiness, IScopedDependency
    {
        private IServiceProvider SvcProvider { get; set; }
        public Sys_MenuBusiness(GDbContext context, IServiceProvider svcProvider)
            : base(context)
        {
            this.SvcProvider = svcProvider;
        }

        public async Task<List<Sys_Menu>> GetTreeAsync()
        {
            var all = await this.GetAll(true);
            var tree = TreeHelper.GetTreeList(all);
            return tree;
        }
    }
}
